/************************************************************
 * Copyright (C), 2022-2030, ripnano. Co., Ltd.
 * FileName:        form_setting_version.h
 * Author:          Dan Yin
 * Date:            2023-11-17
 * Description:     designed for switch user mode
 * Version:         1.0.0.0
 **********************************************************/

#ifndef FORM_SETTING_MODE_H
#define FORM_SETTING_MODE_H

// add necessary includes here
#include "ui/defines/global.h"

namespace Ui {
class FormSettingMode;
}

class FormSettingMode : public QWidget
{
    Q_OBJECT

public:
    // Get an instance of "FormSettingMode" class, if exist, return it
    static FormSettingMode* getInstance(QWidget *pParent = nullptr);

signals:
    // The signal that refresh UI info
    void signalRefreshUI();

    // The signal that refresh login mode on the status bar
    void signalRefreshLoginMode(int nLoginMode);

private slots:
    void on_pushButton_UserMode_clicked();

    void on_pushButton_AdminMode_clicked();

    void on_pushButton_FactoryMode_clicked();

    // The slot that refresh UI info
    void slotRefreshUI();

    // Get the reply message from the child window (password verify)
    void slotRespondInfoFromDlg(int nReplyType, bool bAccepted=true);

protected:
    // Triggers an event before it is switch language
    void changeEvent(QEvent *event);

private:
    // The default constructor
    explicit FormSettingMode(QWidget *parent = nullptr);

    // The default destructor
    virtual ~FormSettingMode();

    // After constructing object, initialize the object
    void _Initialze();

    // Init the window style
    void _InitUi();

    // Save the configure
    void _saveModeConfig();

private:
    Ui::FormSettingMode *ui;
};

#endif // FORM_SETTING_MODE_H
